mikeizbicki / cmc-csci143

big data course materials
40 stars 76 forks source link

Question about Git Tutorial #380

Closed danzhechen closed 10 months ago

danzhechen commented 10 months ago

It is more of a conceptual issue than a real coding issue. I am working on the Git Tutorial. More specifically, the DAGs section. I am not really sure about how I understand the second and the third DAG graph where the master branch pointing towards "modified the README" while the user input branch is moving forward.

In my command line output, I got something like this for the master branch:

Danzhe.Chen.24@lambda-server:~/firstrepo$ git checkout master
Already on 'master'
Danzhe.Chen.24@lambda-server:~/firstrepo$ cat message.py
#!/usr/bin/python3
def main(message,input_name):
    if input_name:
        print('enter your name')
        name = input()
    else:
        name = 'world'
    print(f'{message} {name}!')

if __name__=='__main__':
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('--message',choices=['hello','goodbye'])
    parser.add_argument('--input_name',action='store_true')
    args = parser.parse_args()
    main(args.message,args.input_name)

While for the userinput branch I got something like:

Danzhe.Chen.24@lambda-server:~/firstrepo$ git checkout userinput
Switched to branch 'userinput'
Danzhe.Chen.24@lambda-server:~/firstrepo$ cat message.py
#!/usr/bin/python3

def main(message):
    print(f'{message} world!')

if __name__=='__main__':
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('--message',choices=['hello','goodbye'])
    args = parser.parse_args()
    main(args.message)

I am a bit confused since it seems to me that the master branch got updated with the user input feature while the userinput branch is indeed the old branch. How could I make sense the output and the DAGs graph?

Thank you for y'all help in advance.

mikeizbicki commented 10 months ago

This is a fantastic question (and well asked), but I think it'll be much easier to answer in person. So I'd be happy to talk about it during office hours, before/after class or in lab.